Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DYN-8334 Node Cluster Visual Preparation Work #15865

Merged
merged 36 commits into from
Mar 3, 2025
Merged

Conversation

QilongTang
Copy link
Contributor

@QilongTang QilongTang commented Feb 27, 2025

Purpose

This PR is to prepare the visual basics of node cluster per DYN-8334. The baselines are:

  • Introduce a IsPreview state of nodes
  • nodes in preview state should be excluded in graph run
  • nodes in preview state comes with identical visuals
    • Purple overlay, Glyph

TODO:

  • Exclude the nodes in preview state when saving the workspace
  • Get some code to convert from service response to cluster nodes creation

The following examples are using 3 watch node to mock a typical cluster with 3 nodes:
zoomed in:
image

zoomed out:
image

Gif:
ClusterPreview_v2

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB

Release Notes

This PR is to prepare the visual basics of node cluster

Reviewers

@BogdanZavu @chubakueno

FYIs

@johnpierson @Jingyi-Wen

@QilongTang QilongTang added this to the 3.5 milestone Feb 27, 2025
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-8334

@mjkkirschner
Copy link
Member

Does this PR actually stop these nodes from being executed somehow? I don't think just disabling their preview bubbles is doing that or is that work WIP?

//Get those modified nodes that are not frozen
foreach (var node in workspace.Nodes.Where(n => n.IsModified && !n.IsFrozen))
//Get those modified nodes that are not frozen or preview states
foreach (var node in workspace.Nodes.Where(n => n.IsModified && !n.IsFrozen && !n.IsPreview))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mjkkirschner I think this line exclude the nodes from execution, right?

Copy link
Contributor

@BogdanZavu BogdanZavu Feb 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about if we modify the Nodes property so that we can be sure preview nodes are ignored in all contexts.
And I guess we'll only account for them in all mechanisms engaged during preview placement.

Copy link
Member

@mjkkirschner mjkkirschner Feb 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure - I would take a look at all the places is IsFrozen is referenced - I kind of remember changes had to be made at the AST level to avoid the codegen step for frozen nodes - but it was a really long time ago.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think currently I covered all the place IsFrozon is referenced and relevant

writer.WritePropertyName("Nodes");
serializer.Serialize(writer, ws.Nodes);
serializer.Serialize(writer, ws.Nodes.Where(x => x.IsTransient != true);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would make sure when node/cluster preview is showing and user press save or shortcut, they dont end up into the dyn

@QilongTang
Copy link
Contributor Author

@BogdanZavu @chubakueno I believe the PR is ready for review

@@ -2435,6 +2435,8 @@ Dynamo.ViewModels.NodeViewModel.IsDisplayingLabels.set -> void
Dynamo.ViewModels.NodeViewModel.IsExperimental.get -> bool
Dynamo.ViewModels.NodeViewModel.IsFrozen.get -> bool
Dynamo.ViewModels.NodeViewModel.IsFrozen.set -> void
Dynamo.ViewModels.NodeViewModel.IsTransient.get -> bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something that we actually want to be public ? I think it's ok for now and we can think/debate later on this subject.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Let me see if I can make it internal for now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like not, the property is bind to UI layer and needs to be public, at least NodeViewModel layer, I can make the NodeModel layer internal

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember right we can have something public and change our mind a little later while in master ? Or no

@BogdanZavu
Copy link
Contributor

LGTM! The Transient state is looking really nice!
I think we can handle this separately right ? Same for the API exposure review
Get some code to convert from service response to cluster nodes creation

@QilongTang
Copy link
Contributor Author

LGTM! The Transient state is looking really nice! I think we can handle this separately right ? Same for the API exposure review Get some code to convert from service response to cluster nodes creation

Yup, thanks for the review, waiting for PR checks

@QilongTang QilongTang merged commit 9bf521e into master Mar 3, 2025
22 of 23 checks passed
@QilongTang QilongTang deleted the NodeClusterVisual branch March 3, 2025 18:53
@QilongTang
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants